<%@ page import="jakarta.servlet.http.Cookie" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/7/26
  Time: 19:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>login</title>
</head>
<body>
    <%!
        String name;
    %>
    <%
        Cookie[] cookies = request.getCookies();
        for(Cookie cookie:cookies){
          if(cookie.getName().equals("uname")){
              name = cookie.getValue();
          }
        }
    %>
    <form action="check.jsp" method="post">
      用户名：<input type="text" name="uname" value="<%=(name==null?"":name)%>"/><br/>
      密码：<input type="password" name="upwd" /><br/>
      <input type="submit" value="登录">
    </form>
</body>
</html>
